package patterns.decorator;

/**
 * Created by lenovo on 2016/11/25 0025.
 * 演示调用装饰类
 */
public class DecoratorPatternDemo {
    public static void main(String[] args){
        IShape circle = new Circle();//未装饰的shape图形。

        //装饰后，具有红色边的图形
        ShapeDecorator redCircle = new RedShapeDecorator(new Circle());
        ShapeDecorator redRectangle = new RedShapeDecorator(new Rectangle());

        System.out.println("未装饰的图形");
        circle.draw();
        System.out.println("\n装饰后的图形");
        redCircle.draw();
        System.out.println("\n装饰后的图形");
        redRectangle.draw();

    }
}
